//
//  WATFBaseViewController.swift
//  WiFiFaster
//
//  Created by one on 2023/12/28.
//

import UIKit

class WATFBaseViewController: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        view.addSubview(watf_bgView)
        view.backgroundColor = .white
        guard let watf_viewBgName = watf_viewBgName() else { return  }
        watf_bgView.image = UIImage(named:watf_viewBgName)
    }
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        navigationController?.setNavigationBarHidden(true, animated: false)
    }
    deinit {
        print(self,"释放了")
        NotificationCenter.default.removeObserver(self)
    }
    
    override var preferredStatusBarStyle: UIStatusBarStyle {
        return .lightContent
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }
    lazy var watf_bgView: UIImageView = {
        let watf_bgView = UIImageView(frame: view.bounds)
        watf_bgView.contentMode = .scaleAspectFill
        return watf_bgView
    }()
    func watf_viewBgName() -> String? {
        return "watf_setting_bg"
    }
    var watf_funcModel: WATFFuncModel?
    var watf_funcClick: Bool = false
}
extension WATFBaseViewController {
    func watf_funcClickModel(watf_funcModel: WATFFuncModel? = nil ) {
        self.watf_funcModel = watf_funcModel
        watf_funcClick = true
        if watf_funcModel?.watf_type == .watf_ftvConnect || watf_funcModel?.watf_type == .watf_ftvDisConnect {
            return
        }
        navigationController?.pushViewController(WATFScanViewController(watf_funcModel: watf_funcModel), animated: true)
    }
}
